<?php
require_once 'index1.php';

if(isset($_REQUEST['attempt'])){
session_start(); //to ensure you are using same session
session_destroy(); //destroy the session
header("refresh:1; url=http://localhost:8080/"); //to redirect back to "index.php" after logging out
echo "logout successfuly";
}else{
    echo 'this page is not allowed';
    header("refresh:2; url=http://localhost:8080");
}


require_once 'index2.php';
?>
